{include file="news/header.tpl"}
	{literal}

		<script>
		function add(){
		    var name=$("#name").val();
		    var remark=$("#remark").val();
		    var type=$("#type").val();
			$.post("/temp/addtemp",{name:name,remark:remark,type:type},function(result){

				  if(result.status==true){
					  alert(result.message);
					             }else{
alert(result.message);
					              }
				},"json");
		}
			
		</script>
	
{/literal}


<!-- 头部// -->
<!-- 头部// -->
{include file="news/top.tpl"}


{include file="news/nav.tpl"}
	<!-- start: Content -->
			<div id="content" class="span10">
			
						
			<div class="row-fluid">


<div class="well"><!-- Default panel contents -->



<div class="box-content">
  
  <form action="/temp/templist" method="post" class="form-inline">
<select name="type" id="type" class="input-small">
{foreach from=$type item=l}
<option value="{$l.id}">{$l.name}</option>
{/foreach}
</select>
<input type="text" name="name" id="name" >
<input type="text" name="remark" id="remark">

<input type="button" value="添加" onclick="return add()" class="btn btn-primary">






</form>
<!-- 工具栏 -->
<table class="table table-hover table-striped">



  <tr>
    <th>
    <div class="btn-group">
  <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
    类型
    <span class="caret"></span>
  </a>
     <ul class="dropdown-menu">
    <!-- dropdown menu links -->
{foreach from=$type item=l}
<li><a href="/temp/templist/?type={$l.id}">{$l.name}</a>
</li>
{/foreach}
  </ul>
  </div>
    
    </th>
    <th >模板名称</th>
     <th>备注</th>
     
     <th>历史</th>
    <th>最近更新</th>
    <th>操作人</th>
  </tr>
  {foreach from=$templist item=l name=g}
  <tr>
  
    <td >{$l.type}</td>
    <td><a href="/temp/edittemp/?id={$l.id}"><i class="icon-edit"></i></a>&nbsp;&nbsp;{$l.name}</td>
  
    <td>{$l.remark}</td>
    <td><a href="/temp/history/?id={$l.id}"><i class="icon-time"></i></a></td>
         <td> {$l.modified|date_format:"%m-%d %H:%M"}</td>
  <td>{$l.action}</td>
  </tr>
      {/foreach}

</table>
<div class="pagination pagination-centered">
<ul id="pager"></ul></div>

</div>




</div>


{literal}
<script type='text/javascript'>
var options = {
currentPage: {/literal}{$num.current}{literal},
totalPages: {/literal}{$num.page}{literal},
numberOfPages:5,
bootstrapMajorVersion:3,
pageUrl: function(type, page, current){
    return '/member/listing/?groupid={/literal}{$groupid}&verify={$verify}&{literal}&p='+page;
}
}
$('#pager').bootstrapPaginator(options);
</script>
{/literal}
{include file="news/footer.tpl"}
